package com.xy.tool.report.view;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zsp on 2018/12/7.
 */
public class Table {

    private String name;
    private boolean striped;
    private Direction stripeDirection = Direction.Vertical;
    private int stripeStartRowIndex;
    private int stripeEndRowIndex;
    private int stripeStartColIndex;
    private int stripeEndColIndex;
    private List<Row> headerList;
    private List<Row> footerList;
    private List<Row> rowList;

    public Table() {
        rowList = new ArrayList<>();
    }

    public Table(String name) {
        this();
        this.name = name;
    }

    public Row createRow() {
        Row row = new Row();
        rowList.add(row);
        return row;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isStriped() {
        return striped;
    }

    public void setStriped(boolean striped) {
        this.striped = striped;
    }

    public Direction getStripeDirection() {
        return stripeDirection;
    }

    public void setStripeDirection(Direction stripeDirection) {
        this.stripeDirection = stripeDirection;
    }

    public int getStripeStartRowIndex() {
        return stripeStartRowIndex;
    }

    public void setStripeStartRowIndex(int stripeStartRowIndex) {
        this.stripeStartRowIndex = stripeStartRowIndex;
    }

    public int getStripeEndRowIndex() {
        return stripeEndRowIndex;
    }

    public void setStripeEndRowIndex(int stripeEndRowIndex) {
        this.stripeEndRowIndex = stripeEndRowIndex;
    }

    public int getStripeStartColIndex() {
        return stripeStartColIndex;
    }

    public void setStripeStartColIndex(int stripeStartColIndex) {
        this.stripeStartColIndex = stripeStartColIndex;
    }

    public int getStripeEndColIndex() {
        return stripeEndColIndex;
    }

    public void setStripeEndColIndex(int stripeEndColIndex) {
        this.stripeEndColIndex = stripeEndColIndex;
    }

    public List<Row> getHeaderList() {
        if(headerList == null) {
            headerList = new ArrayList<>();
        }
        return headerList;
    }

    public List<Row> getFooterList() {
        if(footerList == null) {
            footerList = new ArrayList<>();
        }
        return footerList;
    }

    public List<Row> getRowList() {
        return rowList;
    }
}
